import request from '@/utils/request'

// 查询商品类别列表
export function listCategory(query) {
  return request({
    url: '/goods/category/list',
    method: 'get',
    params: query
  })
}

// 查询商品分类下拉树结构
export function treeselect() {
  return request({
    url: '/goods/category/treeselect',
    method: 'get'
  })
}
// 新增分类
export function addClassification(data) {
  return request({
    url: '/goods/category',
    method: 'POST',
    data
  })
}
// 修改分类
export function modifyClassification(id,data) {
  return request({
    url: `/goods/category/`+id,
    method: 'PUT',
    data
  })
}
// 删除分类
export function deleteClassification(id) {
  return request({
    url: `/goods/category/${id}`,
    method: 'DELETE'
  })
}
